package com.gopay.common.errorcode;

import junit.framework.TestCase;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.gopay.common.domain.proccode.ProcCodeInfo;
import com.gopay.common.proccode.DicProcCodeService;

/**
 * 
 * @ErrorCodeTransform.java
 * @author liujy
 * @2012-12-20 下午7:42:24 www.gopay.com.cn Inc.All rights reserved.
 */
public class ErrorCodeTransform extends TestCase {

    ApplicationContext context = null;

    public void setUp() {
        try {
            context = new ClassPathXmlApplicationContext("spring-config.xml");
            if (context == null) {
                throw new RuntimeException("context init failed");
            }
            System.out.println(context);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void tearDown() {
        System.out.println("tearDown");
    }

    public void testError() {
        try {
            DicProcCodeService dicErrorCodeProService = (DicProcCodeService) context.getBean("dicProcCodeService");
            ProcCodeInfo info = dicErrorCodeProService.switchProcCode("100E1001", "3");// 999T9999
            System.out.println(info);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}